package Support;

import java.awt.Font;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Vector;

import javax.swing.DefaultComboBoxModel;
import javax.swing.border.TitledBorder;

import Form.ForgotPassword;
import Form.Login;
import Form.Main;

//Create multi-language
public class International{
	public static String[] arrHeaderCouriers = new String[]{"Courier Name","Sender Name", "Reciver Name","Login Name"};
	public static String[] arrHeaderRoad = new String[]{"ID","Location A","Location B","Distance (kms)"};
	public String id;
	public static Locale locale;
	public static void setLanguage(Locale locale)
	{
		ResourceBundle rsb = ResourceBundle.getBundle("Support.Language",locale);
		//Login form
		Login.frLogin.setTitle(rsb.getString("frLogin"));
		Login.lbLogin.setText(rsb.getString("lbLogin"));
		Login.lbWarning.setText(rsb.getString("lbWarning"));
		Login.lbLoginName.setText(rsb.getString("lbLoginName"));
		Login.lbPassword.setText(rsb.getString("lbPassword"));
		Login.btnForgotPassword.setText(rsb.getString("btnForgotPassword"));
		Login.btnLogin.setText(rsb.getString("btnLogin"));
		Login.btnCancel.setText(rsb.getString("btnCancel"));
	}
	
	public static void setLanguageForgotPassword(Locale locale)
	{
		ResourceBundle rsb = ResourceBundle.getBundle("Support.Language",locale);
		ForgotPassword.frmForgotPassword.setTitle(rsb.getString("frmForgotPassword"));
		ForgotPassword.lbForgotLoginName.setText(rsb.getString("lbForgotLoginName"));
		ForgotPassword.lbForgotQuestion.setText(rsb.getString("lbForgotQuestion"));
		ForgotPassword.lbForgotAnswer.setText(rsb.getString("lbForgotAnswer"));
		ForgotPassword.btnForgotSend.setText(rsb.getString("btnForgotSend"));
		ForgotPassword.btnForgotCancel.setText(rsb.getString("btnForgotCancel"));
		ForgotPassword.lbForgotNoteEmail.setText(rsb.getString("lbForgotNoteEmail"));
	}
	
	public static void setLanguageMain(Locale locale)
	{
		ResourceBundle rsb = ResourceBundle.getBundle("Support.Language",locale);
		//Frame
			Main.frmCourierManagementSystem.setTitle(rsb.getString("CourierManagement"));
		//Tabs
			Main.mnSystem.setText(rsb.getString("mnSystem"));
			Main.mnLanguage.setText(rsb.getString("mnLanguage"));
			Main.mnHelp.setText(rsb.getString("mnHelp"));
			Main.itemLogout.setText(rsb.getString("itemLogout"));
			Main.itemExit.setText(rsb.getString("itemExit"));
			Main.itemAbout.setText(rsb.getString("itemAbout"));
			Main.itemHelp.setText(rsb.getString("mnHelp"));
			Main.tabbedPane.setTitleAt(0, rsb.getString("pnEmployees"));
			Main.tabbedPane.setTitleAt(1, rsb.getString("pnCouriers"));
			Main.tabbedPane.setTitleAt(2, rsb.getString("pnMyInfo"));
			Main.tabbedPaneEmployees.setTitleAt(0, rsb.getString("pnListEmployees"));
			Main.tabbedPaneEmployees.setTitleAt(1, rsb.getString("pnAddEmployee"));
			Main.tabbedPaneEmployees.setTitleAt(2, rsb.getString("pnAtt"));
			Main.tabbedPaneEmployees.setTitleAt(3, rsb.getString("pnConn"));
		//Employees
		///Find
			Main.pnFindEmployee.setBorder(new TitledBorder(null, rsb.getString("pnFindEmployee"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.lblFindLoginName.setText(rsb.getString("lbFindLoginName"));
			Main.lblFindFunction.setText(rsb.getString("lbFindFunction"));
			Main.lblFindWorkingStatus.setText(rsb.getString("lbFindWorkingStatus"));
			Main.btnFindEmployee.setText(rsb.getString("btnFindEmployee"));
		///List
			Main.pnListTableEmployee.setBorder(new TitledBorder(null, rsb.getString("pnListTableEmployee"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
		///Info
			Main.pnInfoEmployee.setBorder(new TitledBorder(null, rsb.getString("pnInfoEmployee"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.lblInfoLoginName.setText(rsb.getString("lbInfoLoginName"));
			Main.lblInfoDateCreated.setText(rsb.getString("lbInfoDateCreated"));
			Main.lblInfoName.setText(rsb.getString("lbInfoName"));
			Main.lblInfoAddress.setText(rsb.getString("lbInfoAddress"));
			Main.lblInfoPhone.setText(rsb.getString("lbInfoPhone"));
			Main.lblInfoEmail.setText(rsb.getString("lbInfoEmail"));
			Main.lblInfoFunction.setText(rsb.getString("lbInfoFunction"));
			Main.lblInfoWorkingStatus.setText(rsb.getString("lbInfoWorkingStatus"));
			Main.btnDeleteEmployee.setText(rsb.getString("btnDeleteEmployee"));
			Main.btnEditEmployee.setText(rsb.getString("btnEditEmployee"));
			Main.btnInfoAvatar.setToolTipText(rsb.getString("ChangeAvatar"));
			Main.btnShowAllEmployees.setText(rsb.getString("btnShowAllCourier"));
		///Add
			Main.lbAddLoginName.setText(rsb.getString("lbAddLoginName"));
			Main.lbAddName.setText(rsb.getString("lbAddName"));
			Main.lbAddAddress.setText(rsb.getString("lbAddAddress"));
			Main.lbAddPhone.setText(rsb.getString("lbAddPhone"));
			Main.lbAddFunction.setText(rsb.getString("lbAddFunction"));
			Main.lbAddWorkingStatus.setText(rsb.getString("lbAddWorkingStatus"));
			Main.lbAddSecurityQuestion.setText(rsb.getString("lbAddSecurityQuestion"));
			Main.lbAddYourAnswer.setText(rsb.getString("lbAddYourAnswer"));
			Main.lbAddDate.setText(rsb.getString("lbAddDate"));
			Main.btnAddEmployee.setText(rsb.getString("btnAddEmployee"));
			Main.btnAddAvatar.setToolTipText(rsb.getString("ChangeAvatar"));
		//My info
			Main.btnMyInfoAvatar.setToolTipText(rsb.getString("ChangeAvatar"));
			Main.lbMyInfoLoginName.setText(rsb.getString("lbMyInfoLoginName"));
			Main.lbMyInfoName.setText(rsb.getString("lbMyInfoName"));
			Main.lbMyInfoAddress.setText(rsb.getString("lbMyInfoAddress"));
			Main.lbMyInfoDateCreated.setText(rsb.getString("lbMyInfoDateCreated"));
			Main.lbMyInfoPhone.setText(rsb.getString("lbMyInfoPhone"));
			Main.lbMyInfoEmail.setText(rsb.getString("lbMyInfoEmail"));
			Main.lbMyInfoFunction.setText(rsb.getString("lbMyInfoFunction"));
			Main.lbMyInfoWorkingStatus.setText(rsb.getString("lbMyInfoWorkingStatus"));
			Main.btnMyInfoDefault.setText(rsb.getString("btnMyInfoDefault"));
			Main.btnMyInfoEdit.setText(rsb.getString("btnMyInfoEdit"));
			Main.pnChangeMyPassword.setBorder(new TitledBorder(null, rsb.getString("pnChangeMyPassword"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.lbMyInfoCurrentPassword.setText(rsb.getString("lbMyInfoCurrentPassword"));
			Main.lbMyInfoNewPassword.setText(rsb.getString("lbMyInfoNewPassword"));
			Main.lbMyInfoConfirmNewPassword.setText(rsb.getString("lbMyInfoConfirmNewPassword"));
			Main.btnMyInfoChange.setText(rsb.getString("btnMyInfoChange"));
		///Working status
			Main.cbFindWorkingStatus.setModel(new DefaultComboBoxModel(new String[]{rsb.getString("OnProbation"),rsb.getString("Working"),rsb.getString("OnLeaveOfAbsence"),rsb.getString("Quit"),rsb.getString("All")}));
			Main.cbFindWorkingStatus.setSelectedIndex(4);
			Main.cbInfoWorkingStatus.setModel(new DefaultComboBoxModel(new String[]{rsb.getString("OnProbation"),rsb.getString("Working"),rsb.getString("OnLeaveOfAbsence"),rsb.getString("Quit")}));
			Main.cbAddWorkingStatus.setModel(new DefaultComboBoxModel(new String[]{rsb.getString("OnProbation"),rsb.getString("Working")}));
		//Security question
			Main.cbAddSecurityQuestion.setModel(new DefaultComboBoxModel(new String[] {rsb.getString("q1"),rsb.getString("q2"),rsb.getString("q3"),rsb.getString("q4"),rsb.getString("q5")}));
		//Courier Management
		///Management
			Main.tabbedPaneCouriers.setTitleAt(0, rsb.getString("pnCouManagement"));
			Main.tabbedPaneCouriers.setTitleAt(0, rsb.getString("pnCouCalculator"));
			Main.pnFindCourier.setBorder(new TitledBorder(null, rsb.getString("pnFindCourier"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnCourierService.setBorder(new TitledBorder(null, rsb.getString("pnCourierService"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			//Main.pnListCouriers.setBorder(new TitledBorder(null, rsb.getString("pnListCouriers"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnInfoCourier.setBorder(new TitledBorder(null, rsb.getString("pnInfoCourier"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnCouSender.setBorder(new TitledBorder(null, rsb.getString("pnCouSender"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			
			Main.pnCouReceiver.setBorder(new TitledBorder(null, rsb.getString("pnCouReceiver"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.lbCoFindCourierName.setText(rsb.getString("lbCoFindCourierName"));
			Main.lbCoFindLoginName.setText(rsb.getString("lbCoFindLoginName"));
			Main.lbCoFindNameSender.setText(rsb.getString("lbCoFindNameSender"));
			Main.lbCoFindNameReceiver.setText(rsb.getString("lbCoFindNameReceiver"));
			
			Main.btnfindCourier.setText(rsb.getString("btnfindCourier"));
			Main.btnShowAllCourier.setText(rsb.getString("btnShowAllCourier"));
			Main.rdbtnCouUpdate.setText(rsb.getString("rdbtnCouUpdate"));
			Main.rdbtnCouNew.setText(rsb.getString("rdbtnCouNew"));
			Main.rdbtnCouDelete.setText(rsb.getString("rdbtnCouDelete"));
			Main.lbCoInfoDateCreated.setText(rsb.getString("lbCoInfoDateCreated"));
			Main.lbCoInfoCourierName.setText(rsb.getString("lbCoInfoCourierName"));
			Main.lbCoInfoLoginName.setText(rsb.getString("lbCoInfoLoginName"));
			Main.lbCoInfoStatus.setText(rsb.getString("lbCoInfoStatus"));
			Main.lbCoInfoWeight.setText(rsb.getString("lbCoInfoWeight"));
			Main.lbCoInfoAmount.setText(rsb.getString("lbCoInfoAmount"));
			Main.lbSenderName.setText(rsb.getString("lbSenderName"));
			Main.lbSenderAddress.setText(rsb.getString("lbSenderAddress"));
			Main.lbSenderLocation.setText(rsb.getString("lbSenderLocation"));
			Main.lbSenderPhone.setText(rsb.getString("lbSenderPhone"));
			Main.lbReceiverName.setText(rsb.getString("lbReceiverName"));
			Main.lbReceiverAddress.setText(rsb.getString("lbReceiverAddress"));
			Main.lbReceiverLocation.setText(rsb.getString("lbReceiverLocation"));
			Main.lbReceiverPhone.setText(rsb.getString("lbReceiverPhone"));
			
	
		///Calculator
			Main.pnAddNewLocation.setBorder(new TitledBorder(null, rsb.getString("pnAddNewLocation"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnAddNewRoute.setBorder(new TitledBorder(null, rsb.getString("pnAddNewRoute"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnListLocations.setBorder(new TitledBorder(null, rsb.getString("pnListLocations"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnListRoutes.setBorder(new TitledBorder(null, rsb.getString("pnListRoutes"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnCharges.setBorder(new TitledBorder(null, rsb.getString("pnCharges"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.lbLocation.setText(rsb.getString("lbLocation"));
	
			Main.lbFrom.setText(rsb.getString("lbFrom"));
			Main.lbTo.setText(rsb.getString("lbTo"));
			Main.lbDistance.setText(rsb.getString("lbDistance"));
			Main.btnAddNewLocation.setText(rsb.getString("btnAddNewLocation"));
			Main.btnAddNewRoute.setText(rsb.getString("btnAddNewRoute"));
			Main.lblDate_2.setText(rsb.getString("lblDate_2"));
			arrHeaderCouriers = new String[]{rsb.getString("lbCoFindCourierName"),rsb.getString("lbCoFindNameSender"),rsb.getString("lbCoFindNameReceiver"),rsb.getString("lbCoFindLoginName")};
			arrHeaderRoad = new String[]{rsb.getString("ID"),rsb.getString("locationA"), rsb.getString("locationB"),rsb.getString("distance")};
	
	//===========================ATTENDANCE==================================
			Main.pnAttSearch.setBorder(new TitledBorder(null, rsb.getString("pnAttSearch"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnAttList.setBorder(new TitledBorder(null, rsb.getString("pnAttList"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.lblAttSearchLoginname.setText(rsb.getString("lbAttSearchLogin"));
			Main.lblAttSearchFunction.setText(rsb.getString("lbAttSearchFunc"));			
			Main.lblAttSearchAbsence.setText(rsb.getString("lbAttSearchAbs"));
			Main.lblAttSearchDate.setText(rsb.getString("lbAttSearchDate"));
			Main.lblNow.setText(rsb.getString("lbNow"));
			Main.lblDate.setText(rsb.getString("lbDate"));
			Main.btnAttShowAll.setText(rsb.getString("btnAttShowAll"));
			Main.btnAttSearch.setText(rsb.getString("btnAttSearch"));
			Main.btnAttDefault.setText(rsb.getString("btnAttDefault"));
			Main.btnAttSave.setText(rsb.getString("btnAttSave"));
			Main.btnAttDetail.setText(rsb.getString("btnConnDetail"));
			Main.cbAttSearchAbsence.setModel(new DefaultComboBoxModel(new String[]{rsb.getString("ab1"),rsb.getString("ab2"),rsb.getString("ab3")}));
	//===========================CONNECTION==================================
			Main.lbConnLogin.setText(rsb.getString("lbConnlogin"));
			Main.lbConnDate.setText(rsb.getString("lbConnDate"));
			Main.btnConnSearch.setText(rsb.getString("btnConnSearch"));
			Main.btnConnShowAll.setText(rsb.getString("btnConnShowAll"));
			Main.btnDefaultConn.setText(rsb.getString("btnConnDefault"));
			Main.btnDeleteConn.setText(rsb.getString("btnConnDel"));
			Main.btnEmployeeDetail.setText(rsb.getString("btnConnDetail"));
			Main.btnSelectAllConn.setText(rsb.getString("btnConnSelectAll"));
			Main.btnSendMail.setText(rsb.getString("btnConnSend"));	
			Main.pnConnList.setBorder(new TitledBorder(null, rsb.getString("pnConnList"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
			Main.pnConnSearch.setBorder(new TitledBorder(null, rsb.getString("pnConnSearch"), TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 17), null));
	}
}
